<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>注册</title>
		<script src="js/md5.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jmessage-sdk-web-2.1.0.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div class="header">

		</div>
		<form class="registercontent" method="get">
			<p><input type="text" name="username" id="username" value="" placeholder="邮箱/用户名" /></p>
			<p><input type="password" name="password" id="password" value="" placeholder="密码" /></p>
			<p><input type="submit" name="register" id="register" value="注册" onclick="myregisters()" /></p>
		</form>
		<script type="text/javascript">
			function myregisters() {
				JIM.register({
					'username': $("#username").val(),
					'password': $("#password").val(),
					'is_md5': false
				}).onSuccess(function(data) {
					 console.log('success:' + JSON.stringify(data.code));
					console.log("注册成功");
					location.href="index.html";
				}).onFail(function(data) {
					 console.log('error:' + JSON.stringify(data))
//					appendToDashboard('error: ' +JSON.stringify(data));
				});
			}
		</script>
	</body>

</html>